#include<iostream>
using namespace std;
#include<queue>
int a[10]={4,8,3,41,15,26,11,75,49,10};
struct node{
	int x,y,z;
	bool operator<(const node& t) const{
		return y<t.y;
	}
};
//int main(){
////	priority_queue<int> q;
////	priority_queue<int,vector<int>,greater<int>> q;
////	priority_queue<int,vector<int>,less<int>> q;
//	for(int i=0;i<10;i++){
//		q.push(a[i]);
//	} 
//	
//	while(q.size()){
//		cout<<q.top()<<" ";
//		q.pop();
//	}
//	cout<<endl;
//	return 0;
//}


int main(){
	priority_queue<node> q;
	for(int i=1;i<10;i++){
		q.push({i,i*(-1),i});
	} 
	while(q.size()){
		node u=q.top();
		q.pop();
		cout<<u.x<<" "<<u.y<<" "<<u.z<<endl;
	}
	cout<<endl;
	return 0;
}
